package org.zlm.git_study.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.zlm.git_study.interceptor.InterfaceInterceptor;

/**
 * @author zlm
 * @date 2023/12/22
 * 拦截器注册到Springboot中
 */
@Configuration
@RequiredArgsConstructor
public class InterfaceConfig implements WebMvcConfigurer {
    private final InterfaceInterceptor interceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptor);
    }
}
